<template>
    <div >

        <yd-cell-group class="demo-small-pitch">
            <yd-cell-item v-if="partnerName.length>0">
                <span slot="left" style="color: #989898">所属客户</span>
                <span slot="right" style="color: #707070">{{partnerName}}</span>
            </yd-cell-item>

            <yd-cell-item  v-if="instName.length>0">
                <span slot="left" style="color: #989898">所属机构</span>
                <span slot="right" style="color: #707070">{{instName}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="typeName.length>0">
                <span slot="left" style="color: #989898">设备类型</span>
                <span slot="right" style="color: #707070">{{typeName}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="name.length>0">
                <span slot="left" style="color: #989898">设备名称</span>
                <span slot="right" style="color: #707070">{{name}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="brand.length>0">
                <span slot="left" style="color: #989898">品牌</span>
                <span slot="right" style="color: #707070">{{brand}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="purchaseDate.length>0">
                <span slot="left" style="color: #989898">采购日期</span>
                <span slot="right" style="color: #707070">{{purchaseDate}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="amt.length>0">
                <span slot="left" style="color: #989898">采购金额</span>
                <span slot="right" style="color: #707070">{{amt}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="departmentName.length>0">
                <span slot="left" style="color: #989898">使用部门</span>
                <span slot="right" style="color: #707070">{{departmentName}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="sn.length>0">
                <span slot="left" style="color: #989898">设备序列号</span>
                <span slot="right" style="color: #707070">{{sn}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="assetsCode.length>0">
                <span slot="left" style="color: #989898">资产编号</span>
                <span slot="right" style="color: #707070">{{assetsCode}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="receiptor.length>0">
                <span slot="left" style="color: #989898">领用人</span>
                <span slot="right" style="color: #707070">{{receiptor}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="receiptTime.length>0">
                <span slot="left" style="color: #989898">领用时间</span>
                <span slot="right" style="color: #707070">{{receiptTime}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="ip.length>0">
                <span slot="left" style="color: #989898">IP地址</span>
                <span slot="right" style="color: #707070">{{ip}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="mac.length>0">
                <span slot="left" style="color: #989898">MAC地址</span>
                <span slot="right" style="color: #707070">{{mac}}</span>
            </yd-cell-item>
            <yd-cell-item v-if="facilitator.length>0">
                <span slot="left" style="color: #989898">厂商支持人</span>
                <span slot="right" style="color: #707070">{{facilitator}}</span>
            </yd-cell-item>

            <yd-cell-item v-if="facilitator_tel.length>0">
                <span slot="left" style="color: #989898">厂商支持电话</span>
                <span slot="right" style="color: #707070">{{facilitator_tel}}</span>
            </yd-cell-item>
            <yd-cell-item v-if="remark.length>0">
                <span slot="left" style="color: #989898">备注</span>
                <span slot="right" style="color: #707070">{{remark}}</span>
            </yd-cell-item>


        </yd-cell-group>


    </div>

</template>

<script>
    import {machineCodeDetails} from "../../pcof/post";
    import {userInfoData} from '../../globalVariables'
    export default {
        name: "equipmentDetail",
        data() {
            return {
                equipUuid:'',
                partnerName:'',//所属客户
                instName:'',//所属机构
                typeName:'',//设备类型
                name:'', //设备名称
                brand:'',//品牌
                purchaseDate:'',//采购日期
                amt:'',//采购金额
                departmentName:'',//使用部门
                sn:'',//设备序列号
                assetsCode:'',// 资产编号
                receiptor:'',// 领用人
                receiptTime:'',//领用时间
                ip:'',// IP地址
                mac:'',// mac地址
                facilitator:'',//厂商支持人
                facilitator_tel:'',//厂商支持电话
                remark:'',// remark 备注
            }

        },
        async created() {
            //接受上个页面传值 在实例创建完成后被立即调用
            this.equipUuid = this.$route.params.equipmentuuid;
            var mobile = JSON.parse(localStorage.getItem(userInfoData)).mobile;
            this.$dialog.loading.open('加载中...');
            var response = await machineCodeDetails(mobile,'',this.equipUuid);

            if (response.data.code === 200) {
                this.$dialog.loading.close();
                var datalist={};
                datalist=response.data.data;
                //所属客户
                if (datalist.partnerName===null||datalist.partnerName==='')
                {

                }else
                {
                    this.partnerName=datalist.partnerName;
                }

                //所属机构
                if (datalist.instName===null||datalist.instName==='')
                {

                }else
                {
                    this.instName=datalist.instName;
                }

                //设备类型
                if (datalist.typeName===null||datalist.typeName==='')
                {

                }else
                {
                    this.typeName=datalist.typeName;
                }
                //设备名称
                if (datalist.name===null||datalist.name==='')
                {

                }else
                {
                    this.name=datalist.name;
                }
                    //品牌
                if (datalist.brand===null||datalist.brand==='')
                {

                }else
                {
                    this.brand=datalist.brand;
                }
                    //采购日期
                if (datalist.purchaseDate===null||datalist.purchaseDate==='')
                {

                }else
                {
                    this.purchaseDate=datalist.purchaseDate;
                }
                //采购金额
                if (datalist.amt===null||datalist.amt==='')
                {

                }else
                {
                    this.amt=datalist.amt;
                }
                    //使用部门
                if (datalist.departmentName===null||datalist.departmentName==='')
                {

                }else
                {
                    this.departmentName=datalist.departmentName;
                }
                //设备序列号
                if (datalist.sn===null||datalist.sn==='')
                {

                }else
                {
                    this.sn=datalist.sn;
                }
                // 资产编号
                if (datalist.assetsCode===null||datalist.assetsCode==='')
                {

                }else
                {
                    this.assetsCode=datalist.assetsCode;
                }
                // 领用人
                if (datalist.receiptor===null||datalist.receiptor==='')
                {

                }else
                {
                    this.receiptor=datalist.receiptor;
                }
                 //领用时间
                if (datalist.receiptTime===null||datalist.receiptTime==='')
                {

                }else
                {
                    this.receiptTime=datalist.receiptTime;
                }
                    // IP地址
                if (datalist.ip===null||datalist.ip==='')
                {

                }else
                {
                    this.ip=datalist.ip;
                }
                // MAC 地址
                if (datalist.mac===null||datalist.mac==='')
                {

                }else
                {
                    this.mac=datalist.mac;
                }
                //备注
                if (datalist.remark===null||datalist.remark==='')
                {

                }else
                {
                    this.remark=datalist.remark;
                }

                // facilitator:'',//厂商支持人
                if (datalist.facilitator===null||datalist.facilitator==='')
                {

                }else
                {
                    this.facilitator=datalist.facilitator;
                }

                // facilitator_tel:'',//厂商支持电话
                if (datalist.facilitator_tel===null||datalist.facilitator_tel==='')
                {

                }else
                {
                    this.facilitator_tel=datalist.facilitator_tel;
                }
            }
            else
            {
                this.$dialog.loading.close();
                console.log(response.data.msg);
                this.$dialog.toast({
                    mes: response.data.msg,
                    timeout: 1500
                });
            }
        },


    methods: {


        },







    };

</script>

<style lang="scss">
    @import "./equipment.scss";
    .top-name {
        color: white;
        background-color: #3cc8a8;
        /*border-top-left-radius: 8px;//左上角*/

        /*border-bottom-left-radius: 8px;//左下角*/
    }
    .top-name1 {
        color: black;
        background-color:#e8e8e8 ;
        /*border-top-right-radius:8px; //右上角*/
        /*border-bottom-right-radius: 8px;//右下角*/
    }
    .demo-small-pitch {
        margin-top: .10rem;
    }
    .repair-button-back {
        margin-top: .10rem;
        background-color:#eaf4f4;
        border-radius: 6px;
        border-width: 1px;
        border-color: #3cc8a8;
        height: 0.6rem;
        font-size: 0.3rem;
        padding-top: 0.15rem;
        width: 80%;
    }






</style>